
function delete_image(type,id,url){
	var answer = confirm("Are you sure to delete?");
	
	if(answer){
		//alert(type);
		$.post( 
            url+"/Headers/image_delete",
            {
				type: type,
				id:id,
			},
            function(data){
				if(type=="header_image"){
					var img = "<img src='"+url+"/app/webroot/upload/blank_header.png' width='300' height='50'>";
					$("#display_header").html(img);
				}else{
					var img = "<img src='"+url+"/app/webroot/upload/blank_logo.png' width='100' height='50'>";
					$("#display_logo").html(img);
				}
				
				
				
            }

          );
	}
}

function check_password(){
	
	var pass = $("#UserPassword").val();
	var confirmpass = $("#ConfirmPassword").val();
	
	if(pass.length>0){
		if(pass==confirmpass){
			return true;
		}else{
			var error = "<div class='error-message'>Password doesn't match.</div>";
			$("#password_error").html(error);
			//alert("Password doesn't match");
			return false;
		}
	}
	
	
	return true;
}